Avoid a segfault if license is NULL
authorMatthias Clasen <mclasen@redhat.com>
Fri, 4 Sep 2009 22:22:30 +0000 (18:22 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Sep 2009 22:22:30 +0000 (18:22 -0400)
The license field was introduced later on, so some out-of-tree loaders
may not set it. And Solaris printf() doesn't take NULL for a string...
Bug 594178.

gdk-pixbuf/queryloaders.c

index ba81638992b128a82e4400e32a769476dc510d28..71805d43eea5a7200011067f167c282745085837 100644 (file)
@@ -119,17 +119,20 @@ loader_sanity_check (const char *path, GdkPixbufFormat *info, GdkPixbufModule *v
        return 0;
 }
 
-static void 
+static void
 write_loader_info (const char *path, GdkPixbufFormat *info)
 {
        const GdkPixbufModulePattern *pattern;
-       char **mime; 
-       char **ext; 
+       char **mime;
+       char **ext;
 
        g_printf("\"%s\"\n", path);
-       g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n", 
-                 info->name, info->flags, 
-                 info->domain ? info->domain : GETTEXT_PACKAGE, info->description, info->license);
+       g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n",
+                 info->name,
+                  info->flags,
+                 info->domain ? info->domain : GETTEXT_PACKAGE,
+                  info->description,
+                  info->license ? info->license : "");
        for (mime = info->mime_types; *mime; mime++) {
                g_printf ("\"%s\" ", *mime);
        }